import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * user:likai
 * Date:2022-09-16
 * Time:14:55
 */
public class Test {
    public static int Judge1(int x){
        int sum=0;
        for (int i = 0; i < 32; i++) {
            if(((x>>i)&1)==1){
                sum++;
            }
        }
        return sum;
    }
    public static float Judge2(int x){
        float sum=0.0f;
        for (int i = 1; i < x; i++) {
            if(i%2==0){
                sum-=(1/(i*1.0));
            }else {
                sum+=(1/(i*1.0));
            }
        }
        return sum;
    }
    public static int daffodil(int x){
        int sum=0;
        while(x!=0){
            sum+=java.lang.Math.pow((x%10),3);
            x/=10;
        }
        return sum;
    }

    public static void main1(String[] args) {
//        Scanner scanner=new Scanner(System.in);
//        //int x=scanner.nextInt();
////        int sum=Judge1(x);
////        System.out.println(sum);
//        int y=scanner.nextInt();
//        float sum=Judge2(y);
//        System.out.println(sum);
        for (int i = 100; i <1000 ; i++) {
            if(i==daffodil(i)){
                System.out.println(i);
            }
        }
//        int x=daffodil(153);
//        System.out.println(x);
    }

    public static void multiplicationTable(int n){
        for (int i = 0; i < n+1; i++) {
            for (int j = 0; j < i; j++) {
                System.out.print(i+"*"+j+"="+i*j+" ");
            }
            System.out.println();
        }
    }
    public static void main2(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        multiplicationTable(n);
    }

    public static void X(int x){
        int l=0;
        int r=x-1;
        for (int i = 0; i < x; i++) {
            for (int j = 0; j < x; j++) {
                if(j==l||j==r){
                    System.out.print("*");
                }else {
                    System.out.print(" ");
                }
            }
            l++;
            r--;
            System.out.println();
        }
    }
    public static void main3(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int x=scanner.nextInt();
        X(x);
    }

    public static void everyone(int x){
        while(x!=0){
            if(x/10==0){
                System.out.println(x%10);
            }else{
                System.out.print(x%10+",");
            }
            x/=10;
        }
    }
    public static void main4(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int x=scanner.nextInt();
        everyone(x);
    }

    public static void main5(String[] args) {
        System.out.println("请设置密码：");
        Scanner scanner =new Scanner(System.in);
        String s=scanner.nextLine();
        for (int i = 0; i < 3; i++) {
            System.out.print("请输入密码：");
            String a=scanner.nextLine();
            if(s.equals(a)){
                System.out.println("输入正确");
                break;
            }else {
                System.out.println("密码错误，请重新输入");
                if(i==2){
                    System.out.println("退出程序");
                }
            }
        }
//        String i="sdd";
//        String j="sdd";
//        if(i==j){
//            System.out.println("yes");
//        }

    }


    public static void main6(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int x=scanner.nextInt();
        int []odd=new int[16];
        int []ous=new int[16];
        int o=15;
        int j=15;
        for (int i = 0; i < 32; i++) {
            if(i%2==0){
                if(((x>>i)&1)==1){
                    odd[j]=1;
                }else {
                    odd[j]=0;
                }
                j--;
            }else{
                if(((x>>i)&1)==1){
                    ous[o]=1;
                }else {
                    ous[o]=0;
                }
                o--;
            }
        }
        for (int i = 0; i < 16; i++) {
            System.out.print(odd[i]);
        }
        System.out.println();
        for (int i = 0; i < 16; i++) {
            System.out.print(ous[i]);
        }
    }

    public static int max2(int x,int y){
        if(x>=y){
            return x;
        }else {
            return y;
        }
    }
    public static int max3(int x,int y,int z){
        return max2(max2(x,y),z);
    }
    public static void main7(String[] args) {
        int sum=max3(1,2,3);
        System.out.println(sum);
    }

    public static int factorial(int  n){
        int sum=1;
        for (int i = 1; i <=n; i++) {
            sum*=i;
        }
        return sum;
    }
    public static void main8(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        int sum=1;
        for (int i = 1; i <=n; i++) {
            sum*=i;
        }
//        int sum=0;
//        for (int i = 1; i <= n; i++) {
//            sum+=factorial(i);
//        }
        System.out.println(sum);
    }
    public static  int fib(int n){
        if(n==1||n==2){
            return 1;
        }
        return fib(n-1)+fib(n-2);
    }
    public static void main9(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        int sum=fib(n);
        System.out.println(sum);
    }
    public static int sum(int x,int y){
        return x+y;
    }
    public static float sum(float x,float y,float z){
        return x+y+z;
    }
    public static void main10(String[] args) {
        int a=1;
        int b=2;
        float x=1.0f;
        float z=1.0f;
        float y=1.0f;
        System.out.println(sum(a, b));
        System.out.println(sum(x, y, z));
    }
    public static int MaxNumber(int x,int y){
        return (x>y?x:y);
    }
    public static int MaxNumber(int x,int y,int z){
        return ((x>y?x:y)>z?(x>y?x:y):z);
    }

    public static void main11(String[] args) {
        System.out.println(MaxNumber(1, 2, 3));
    }

    public static int fib1(int n){
        if(n==1){
            return 1;
        }else {
            return n*fib1(n-1);
        }
    }
    public static void main12(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        System.out.println(fib1(n));
    }

    public static int fib2(int n){
        if(n==1){
            return 1;
        } else {
          return n+fib2(n-1);
        }
    }
    public static void main13(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        System.out.println(fib2(n));
    }

    public static void recursion4(int n){
        if(n/10==0){
            System.out.print(n+" ");
        }else{
            recursion4(n/10);
            System.out.print(n%10+" ");
        }
    }
    public static void main14(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        recursion4(n);
    }
    public static int recursion5(int n){
        int sum=0;
        if(n/10==0){
            return n;
        }else{
            return n%10+recursion5(n/10);
        }
    }
    public static void main15(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        System.out.println(recursion5(n));
    }

    public static int fib3(int n){
        if(n==1||n==2){
            return 1;
        }else {
            return fib3(n-1)+fib3(n-2);
        }
    }
    public static void main16(String[] args) {
        System.out.println(fib3(10));
    }

    //第一步需要移动hanio（n-1）
    //第二部需要移动hanio（n-1）加1步
    public static int hanio(int n){
         if(n==1){
             return 1;
         }
        return 2*(hanio(n-1))+1;
    }
    public static void main17(String[] args) {
        System.out.println(hanio(4));
    }

    public static void main18(String[] args) {
        int []array=new int[100];
        for (int i = 1; i <=100 ; i++) {
            array[i-1]=i;
        }
        for (int i = 0; i < 100; i++) {
            System.out.print(array[i]+" ");
            if(i==50){
                System.out.println();
            }
        }
    }

    public static void  printArray(int[]array){
        for (int i = 0; i < array.length; i++) {
            if(i==array.length-1){
                System.out.print(array[i]);
            }else{
                System.out.print(array[i]+",");
            }
        }
    }
    public static void main(String[] args) {
        int []array={1,2,3,4,5,6,7,8,9};
        printArray(array);
    }

}
